php group subarrays by column key

29

$group = array();

foreach ( $array as $value ) {
    $group[$value['id']][] = $value;
}

var_dump($group);

Comments

Submit
0 Comments